package cate.common.table.activity.herotrial;

import cate.common.table.ESheet;
import easy.java.dev.note.NoteClass;

@NoteClass(value = "英雄试炼-关卡")
public class HeroTrialLevelSheet extends ESheet<HeroTrialLevelRow> {
    @Override
    public String getSheetName() {
        return "关卡";
    }

    public HeroTrialLevelRow findRow(int levelGroup, int level, int difficulty) {
        for (HeroTrialLevelRow row : this.getList()) {
            if (row.levelGroup == levelGroup && row.levelTid == level & row.difficulty == difficulty) {
                return row;
            }
        }
        return null;
    }

    public boolean isLastDifficulty(HeroTrialLevelRow row) {
        for (HeroTrialLevelRow levelRow : this.getList()) {
            if (levelRow.levelGroup == row.levelGroup && levelRow.levelTid == row.levelTid && levelRow.difficulty == row.difficulty + 1) {
                return false;
            }
        }
        return true;
    }
}
